package com.junjie.checkin.response;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author 洪浚杰
 * @description
 * @date 2025/6/9 13:31
 */
@Data
@AllArgsConstructor
public class Result<T> {
    private Integer code;
    private String msg;
    private Long timestamp;
    private T data;

    public static<T> Result<T> getResult(ResultStatus status, T data){
        return new Result<T>(status.getCode(), status.getMsg(),System.currentTimeMillis(), data);
    }
    public static Result getResult(ResultStatus status){
        return new Result(status.getCode(), status.getMsg(),System.currentTimeMillis(), null);
    }
}
